package com.alifi.crm.biz.score;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.alibaba.common.logging.Logger;
import com.alibaba.common.logging.LoggerFactory;
import com.alifi.crm.dal.enu.States;
import com.alifi.crm.dal.object.EmployeeScoreDO;
import com.alifi.crm.dal.score.EmployeeScoreDAO;

@Component("employeeScoreManager")
public class EmployeeScoreManagerImpl implements EmployeeScoreManager{

	@Autowired
	private EmployeeScoreDAO employeeScoreDAO;
	
	
	protected static final Logger      logger = LoggerFactory.getLogger(EmployeeScoreManagerImpl.class);
	
	
	@Override
	public void comeIn(String employeeNum) {
		employeeScoreDAO.updateScore(States.进入, employeeNum, null, null, null, null);
	}

	@Override
	public void score(String employeeNum, Long signScore, Long payScore, Long amountScore, Long wholeScore) {
		employeeScoreDAO.updateScore(States.开始, employeeNum, signScore, payScore, amountScore, wholeScore);
	}

	@Override
	public EmployeeScoreDO getEmployeeScore(String employeeNum) {
		return employeeScoreDAO.selectByEmployeeNum(employeeNum);
	}
}
